package com.pzh.guli.service.edu.controller.api;

import com.pzh.guli.service.base.result.Result;
import com.pzh.guli.service.edu.pojo.Subject;
import com.pzh.guli.service.edu.service.ISubjectService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("api/edu/subject")
public class ApiSubjectController {
    @Autowired
    private ISubjectService subjectService;
    @GetMapping("one")
    public Result getOneLevel(){
        List<Subject> oneLevel = subjectService.getOneLevel();
        return Result.ok().data("item",oneLevel);
    }
    @GetMapping("two")
    public Result getTwoLevel(){
        List<Subject> towLevel= subjectService.getTwoLevel();
        return Result.ok().data("item",towLevel);
    }
}
